import { ITableParams, ResPage } from "@/utils/types/table.ts";
import { RadioGroupChildOption } from "ant-design-vue/es/radio/Group";

export interface IRoleTableParams extends ITableParams {
  roleName?: string;
  roleKey?: string;
  startTime?: string;
  endTime?: string;
}
export interface ITableData {
  roleId: number;
  roleName: string;
  roleKey: string;
  roleSort: string;
  statusName: string;
  status?: string;
  createTime: string;
  dataScope?: string;
}
export interface ITypeState {
  tableData: ITableData[];
  loading: boolean;
  total: number;
}

export interface IFormState {
  roleName: string;
  roleKey: string;
  roleSort: number | null;
  status: string;
  menuIds: number[];
  remark: string;
  roleId?: number | null;
  menuCheckStrictly: boolean;
  changeMenu: boolean;
}

export type FormStateKeys = keyof IFormState;

export interface ITreeSelectData {
  label: string;
  id: number;
  children?: ITreeSelectData[];
}

export interface IStateAdd {
  menuTreeData: ITreeSelectData[];
  plainOptions: RadioGroupChildOption[];
  checkType: Array<string>;
  expandedKeys: number[];
}

export interface TTreeDataByRole extends ResPage {
  checkedKeys: number[];
  menus: ITreeSelectData[];
}

export interface IScopeFormState {
  roleName: string;
  roleKey: string;
  roleId?: number | null;
  dataScope: string;
  deptIds: number[];
}
